#pragma once 
#include "cocos2d.h"
#include "Box2D/Box2D.h"
#include "SimpleAudioEngine.h"
using namespace cocos2d;

class Audio
{

public:

	static void bg_play()
	{
		//CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadBackgroundMusic("data\\music.mp3");
	//	CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic("data\\music.mp3",true);
	}

	static void bg_pause()
	{

		CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
	}

	static	void bg_stop()
	{
		CocosDenshion::SimpleAudioEngine::sharedEngine()->stopBackgroundMusic();
	}

	static void end()
	{
		CocosDenshion::SimpleAudioEngine::sharedEngine()->end();
	}

	static void play_menu_click()
	{
		CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\touch.mp3");

	}

	static void isVolume(bool flag)
	{
		if (flag ==false )
		{
			CocosDenshion::SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(0);
			CocosDenshion::SimpleAudioEngine::sharedEngine()->setEffectsVolume(0);
		}
		else
		{
			CocosDenshion::SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(0);
			CocosDenshion::SimpleAudioEngine::sharedEngine()->setEffectsVolume(0);
		}
	}


	static void play_bonus(int a)
	{
		switch (a)
		{
		case  0:break;
		case 20:CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\coin.mp3"); break;
		case 30:CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\coin.mp3"); break;
		case 40:CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\combo_1.mp3"); break;
		case 50:CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\combo_2.mp3"); break;
		case 60:CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\combo_3.mp3"); break;
		default:CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\combo_3.mp3"); break;
	
		}
		
		CCLOG("%d", a);
	}
	static void play_go()
	{
		CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\readygo.mp3");


	}

	static void play_bonus(int a,int z)
	{
		CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("data\\select.mp3");


	}

};



